package com.xiumu.dao.blog;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiumu.pojo.blog.entity.BlogPost;
import com.xiumu.pojo.blog.query.BlogPostQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章信息 Mapper 接口
 *
 * @author XiuMu
 * @Date 2023-01-29 09:25:23
 */
@Service
public interface BlogPostDao extends BaseMapper<BlogPost> {

    /**
     * 分页查询
     *
     * @param query    分页条件
     * @param blogPost 查询条件
     * @return
     */
    Page<BlogPost> selectPage(Page<BlogPost> query, @Param("authority") BlogPostQuery blogPost);

    /**
     * 根据条件查询 BlogPost
     *
     * @param blogPost 查询条件
     * @return
     */
    List<BlogPost> selectByBlogPost(@Param("blogPost") BlogPostQuery blogPost);
}